class EnquiriesController < ApplicationController
  before_filter do
    @department = Department.all
  end

  def index; end

  def create
    @client = Client.add_user(params)

    respond_to do |format|
      unless @client.errors.any?
        UserMailer.create_ticket(@client).deliver

        format.html { redirect_to congratulations_enquiries_path }
        format.xml { render :xml => @client }
      else
        format.html { render :index }
        format.xml { render :xml => @client.errors }
      end
    end
  end

  def congratulations
    render :text => params.inspect
  end
end
